<?php
/**
 * Created by PhpStorm.
 * User: Lee
 * Date: 2021/7/1
 */
namespace App\Services\Backend\System;

use App\Common\Exception\ErrorException;

/**
 * 消息 (服务)
 */
class MessageReadService
{
    /** @var \App\Repositories\Backend\System\MessageReadRepository $messageReadRepository */
    private $messageReadRepository;

    public function __construct()
    {
        $this->messageReadRepository = app('messageReadRepository');
    }

    //*******************外部调用方法****************************************************
    public function getCore($id, $keyName = 'id',$columns = ['*']){
        return $this->messageReadRepository->get($id,$keyName,$columns);
    }

    public function getListCore($filters=[], $sorts =[], $page=1, $columns=['*'], $pageSize=10)
    {
        return $this->messageReadRepository->getList($filters, $sorts, $page, $columns, $pageSize);
    }

    public function getAllCore($filters=[], $sorts =[], $columns=['*'],$whereRaw = FALSE){
        return $this->messageReadRepository->getAll($filters,$sorts,$columns,$whereRaw);
    }

    public function addCore($data){
        return $this->messageReadRepository->add($data);
    }

    public function editCore($data,$id,$keyName='id'){
        return $this->messageReadRepository->edit($data,$id,$keyName);
    }

}
